Availability |
2.0 |
Description |
Writes the specified string to the specified file. If the specified file does not yet exist, it is created. |
Arguments |
fileURL, text, {mode} |
|
 |
The first argument is the file you are writing to, expressed as a file:// URL. |
 |
The second argument is the string to be written. |
 |
The third argument, if supplied, must be "append". If this argument is omitted, the contents of the file are overwritten by the string. |
|
Returns |
TRUE if the string was successfully written to the file, FALSE otherwise. |
Example |
The following code attempts to write the string "xxx" to the file mydata.txt and displays an alert if the write succeeded. It then attempts to append the string "aaa" to the file and displays a second alert if the write succeeded. After executing this script, the file mydata.txt will contain the text xxxaaa and nothing else. |
 |
|